import {QtType_Multi, QtType_Single, QtType_TrueFalse} from "@/constants/Constants_QtType";
import {ExamType_Learn, ExamType_Naire, ExamType_Test} from "@/constants/Constants_ExamType";
import {
    ExamStatus_Finish,
    ExamStatus_NotPublish,
    ExamStatus_Publish,
    ExamStatus_UnKnown
} from "@/constants/Constants_ExamStatus";

export function QtTypeAsString(qtType: number): string {
    if (qtType == QtType_Single) {
        return "单选题";
    }
    if (qtType == QtType_Multi) {
        return "多选题";
    }
    if (qtType == QtType_TrueFalse) {
        return "判断题";
    }
    return "";
}

export function ExamTypeAsString(qtType: number): string {
    if (qtType == ExamType_Naire) {
        return "问卷";
    }
    if (qtType == ExamType_Test) {
        return "考试";
    }
    if (qtType == ExamType_Learn) {
        return "课程";
    }
    return "";
}

export function ExamStatusAsString(examStatus: number): string {
    if (examStatus == ExamStatus_NotPublish || examStatus== ExamStatus_UnKnown) {
        return "未发布";
    }
    if (examStatus == ExamStatus_Publish) {
        return "已发布";
    }
    if (examStatus == ExamStatus_Finish) {
        return "已完成";
    }
    return "";
}

export function GenderAsString(gender: string): string {
    if (gender == "") {
        return "未知";
    }
    if (gender == "01") {
        return "男";
    }
    if (gender == "02") {
        return "女";
    }
    return "";
}